package com.example.mybatisplusdemo.config;


import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("Spring Boot 3.x Knife4j 示例")
                        .version("1.0")
                        .description("基于 OpenAPI 3.0 的接口文档"));
    }

    // 必须加上这个 Bean 才能启用 Knife4j 的扩展功能
//    @Bean
//    public OpenApi3ExtensionResolver openApi3ExtensionResolver() {
//        return new OpenApi3ExtensionResolver();
//    }
}
